<?php
$id_obat=$_GET['id'];
$query=dbQuery("select * from tbobat where id_obat='$id_obat'")or die(mysql_error());
$data=dbAssoc($query);
echo"<table><tr><td colspan='3'>&nbsp;</td></tr>";
	echo"<tr><td colspan='3' class='judul'>&#187 Upadate Data Obat</td></tr>";
	echo"<tr><td colspan='3' class='jarak_garis'><hr color='#6d6a69'>&nbsp;</hr></td></tr></table>";

?>
<form name="edit_obat" id="edit_obat" action="index_admin.php?index=update_obat&cryption=<?php print $encode."*upn*".$santra.$random; ?>" method="post" enctype="multipart/form-data">
<table width="98%" border="0" cellspacing="0" cellpadding="5" class="tabel">
  <tr>
    <td width="250" class="form_insert">Id Obat</td>
    <td width="395" class="jarak_form" ><input name="id_obat" type="text" id="id_obat" maxlength="5" readonly="readonly" value="<?php print $data['id_obat']; ?>" size="25" class="form" ></td>
  </tr>
  
   <tr>
    <td class="form_insert">Nama Obat</td>
    <td class="jarak_form" ><input type="text" value="<?php print $data['nama_obat']; ?>" name="nama_obat"  id="nama_obat" size="50" class="form"  /></td>
  </tr>
  <tr>
    <td class="form_insert">Stok</td>
    <td class="jarak_form" ><input type="text" name="stok"  id="stok" size="50" class="form" value="<?php print $data['stok']; ?>"  /></td>
  </tr>
  <tr>
    <td class="form_insert" >Harga Beli</td>
    <td class="jarak_form"><input type="text" name="harga_beli" value="<?php print $data['harga_beli']; ?>"  id="harga_beli" size="50" class="form"  /></td>
  </tr>
  <tr>
    <td class="form_insert" >Tanggal Masuk</td>
    <td class="jarak_form"><input type="text" name="tgl_masuk" value="<?php print $data['tgl_masuk'];?>"  id="tgl_masuk" readonly="readonly" size="50" class="form"  /></td>
  </tr>
  
   
  <tr>
    <td class="form_insert">Jenis</td>
    <td class="jarak_form" ><select name="id_jenis" class="form" >
	<option value="0" class="form">--Pilih Jenis Obat--</option>
	<?php
	$query2=dbQuery("select * from tbjenis order by id_jenis");
		while($data2=dbAssoc($query2)){
		echo"<option value='$data2[id_jenis]'>$data2[nama_jenis]</option>";
		}
	?>
	</select></td>
  </tr>
   <tr>
    <td class="form_insert">Tanggal Expaired</td>
    <td class="jarak_form" ><input type="text" name="tanggal" id="tanggal" class="form" size="50">&nbsp;<span class="kecil">*(yyyy-mm-dd)</span></td>
  </tr>
   <tr>
    <td class="form_insert">Detail</td>
    <td class="jarak_form" ><textarea name="detail"  id="detail" rows="10" cols="60" class="form"><?php print $data['detail']; ?></textarea></td>
  </tr>
   <tr>
    <td class="form_insert">Gambar</td>
    <td class="jarak_form" ><input type="file" name="gambar" id="gambar" class="form" size="50"></td>
  </tr>
   <tr>
    <td class="form_insert">Satuan</td>
    <td class="jarak_form" ><input type="text" name="satuan"  id="satuan" size="50" class="form" value="<?php print $data['satuan']; ?>"  /></td>
  </tr> <tr>
    <td class="form_insert">Bentuk</td>
    <td class="jarak_form" ><select name="bentuk" class="form">
		<option value="cair" class="form">Cair</option>
		<option value="padat" class="form">Padat</option>
		<option value="setengah_padat" class="form">Setengah Padat</option>
		<option value="setengah_cair" class="form">Setengah Cair</option>
	</select></td>
  </tr>
   <tr>
    <td class="form_insert">Harga Jual</td>
    <td class="jarak_form" ><input type="text" value="<?php print $data['harga_jual'];?>" name="harga_jual"  id="harga_jual" size="50" class="form"  /></td>
  </tr>
   <tr>
    <td class="form_insert">Aturan</td>
    <td class="jarak_form" ><textarea name="aturan"  id="aturan" rows="10" cols="60" class="form"><?php print $data['aturan']; ?></textarea></td>
  </tr>
  <tr>
    <td class="form_insert">Dosis</td>
    <td class="jarak_form" ><input type="text" name="dosis" value="<?php print $data['dosis']; ?>"  id="dosis" size="50" class="form"  /></td>
  </tr>
  <tr>
    <td class="isi_depan">&nbsp;</td>
    <td ><input type="submit" name="add_button_obat" class="button" value="Update Data Obat"  onclick="return add_obat();"></td>
  </tr>
  <tr>
  <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="3">&nbsp;</td>
  </tr>
</table>
</form>
